<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
  String xm = this.getServletContext().getInitParameter("path");
	String path1 = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+"/"+xm;
%>  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>修改支付信息</title>
	<base target="_self" />

	<link href="<%=path1%>/ht/Styles/css.css"
		rel="stylesheet" type="text/css" />
	<link href="<%=path1%>/ht/Styles/ts_css.css"
		rel="stylesheet" type="text/css" />
    <script src="<%=path1%>/ht/Scripts/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script src="<%=path1%>/ht/Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script src="<%=path1%>/ht/Scripts/IndexManager.js" type="text/javascript"></script>

	<script type="text/javascript">
		var obj = window.dialogArguments;
		var opening_pay_id = obj.name;

		function page_Close() {
			if (window.parent != null) {
				window.parent.close();
			} else {
				window.close();
			}
		}

		$.ajax({
	    	url:"<%=path1%>/ht/purpose/selectAlls.do",
	        datatype:'json', 
	        error:function(data){  
	            alert("出错了！！");  
	       },  
	       success:function(data){
	    	  //alert("成功了");	    	   
	    	   //alert(data.msg.length);
	       var len=data.msg.length;

	       var select = document.getElementById("purpose_id");
	       var purpose_id =$("#purpose_id").val();
	       var html="";
	       if(len>0){
	    	   data.msg.forEach(function(e){  
	    		    if(e.purpose_id == purpose_id){
	    		    	alert(e.purpose);
	    		     html+="<option value="+e.purpose_id+" selected='selected'>"+e.purpose+"</option>";
	 	    	   }else{
	 	    		  html+="<option value="+e.purpose_id+">"+e.purpose+"</option>";
	 	    	   }
	    		}) 
	    		//alert(html);
	    		$("#purpose_id").append(html);
	         }
	       }
		});

	</script>
</head>
<body>
<form method="post" action= "<%=path1%>/ht/purpose/updatePurpose.do" id="form1">
		<div id="divTwo">
			<table width="100%" border="0" cellpadding="2" cellspacing="2"
				class="table_list1">

				<tr>
					<td width="40%" class="table_list1_style1">
						<p></p>

					</td>
					<td width="60%" class="table_list1_style2"></td>
				</tr>

 				<tr>
					<td width="20%" class="table_list1_style1">
						<p></p> <span style="color: Red">*</span> 用途:
					</td>
					<td width="50%" class="table_list1_style2"><input
						name="purpose" id="purpose" type="text" id="txtLeved"
						value="${purs.purpose}" class="aspNetDisabled"
						style="width: 200px; height: 18px" /></td>
				</tr> 

				<!-- 取ID的值  不需要显示 -->
				<input name="purpose_id" id="purpose_id" type="hidden"
					value="${purs.purpose_id}" />

				<input type="text" name="update_user" id="update_user" value="${bean.name}"/></td>
				

				<tr>
					<td width="20%" class="table_list1_style1">
						<!-- <p></p> <span style="color: Red">*</span> 修改时间: -->
					</td>
					<td width="50%" class="table_list1_style2"><input type="hidden"
						name="update_time" id="update_time" value="${purs.update_time}"
						style="width: 200px; height: 24px" /></td>
				</tr>

				<tr>
					<td class="table_list1_style1">&nbsp;</td>
					<td class="table_list1_style2">
						<p></p> <input type="submit" id="send" name="btnAdd" value="修改"
						 tabindex="1" class="button" /> &nbsp;&nbsp;
						<input id="btnBack" type="button" class="button" value="关闭"
						onclick="page_Close()" />
					</td>
				</tr>
			</table>
		</div>
	</form>
</body>
</html>